<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout :: head(~{ :: title}, ~{ :: link}, ~{ ::script},~{::style})">
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>商户管理平台-功能管理</title>

    <style></style>
    <link rel="stylesheet" th:href="@{/plugins/jquery-treegrid/css/jquery.treegrid.css}"/>
    <script th:src="@{/plugins/jquery-treegrid/js/jquery.treegrid.js}"></script>
    <script th:src="@{/plugins/jquery-treegrid/js/jquery.treegrid.bootstrap3.js}"></script>
    <script th:inline="javascript">
        $(function(){
            $("#table").treegrid();
        });
    </script>
</head>
<body th:replace="layout::body(~{this::section})">
<section class="content-wrapper">
    <section class="content-header">
        <h1>
            系统功能
            <small>管理</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="/"><i class="fa fa-dashboard"></i> 商户管理平台</a></li>
            <li class="active">功能管理</li>
        </ol>
    </section>
    <section class="content">
        <div th:if="${respMsg != ''}" class="alert alert-danger alert-dismissible">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <h4><i class="icon fa fa-ban"></i> 操作提示</h4>
            <label th:text="${respMsg}"/>
        </div>
        <div class="row">
            <div th:each="opts:${session.WEBOPTS}">
                <div class="col-md-1" th:if="${opts.href == '/MpsFun/Save'}">
                    <a th:href="@{/MpsFun/goMpsFunAdd}" class="btn btn-primary">增加</a>
                </div>
                <!--<div class="col-md-1">-->
                <!--<a class="btn btn-primary">修改</a>-->
                <!--</div>-->
                <!--<div class="col-md-1">-->
                <!--<a class="btn btn-primary">删除</a>-->
                <!--</div>-->
            </div>
        </div>
       <table id="table" class="table">
           <thead>
           <tr>
               <td style="text-align: center">标题</td>
               <td style="text-align: center">图标</td>
               <td style="text-align: center">路径</td>
               <td style="text-align: center">目标</td>
               <td style="text-align: center">排序</td>
               <td style="text-align: center">状态</td>
               <td style="text-align: center">操作</td>
           </tr>
           </thead>
           <tbody>
           <tr th:each="item:${MpsFunList}" th:class="treegrid-+${item.id}" th:classappend="${item.parent}==''?'':'treegrid-parent-'+${item.parent}" style="text-align: center">
               <td th:text="${item.name}"></td>
               <td th:text="${item.iconCls}"></td>
               <td th:text="${item.href}"></td>
               <td th:text="${item.target}"></td>
               <td th:text="${item.sort}"></td>
               <td th:text="${item.status}"></td>
               <td>
                   <!--<a>详情</a>-->
                   <span th:each="opts:${session.WEBOPTS}">
                       <span th:if="${opts.href == '/MpsFun/Update'}">
                           <a th:href="@{/MpsFun/goMpsFunEdit(id=${item.id})}">修改</a>
                       </span>
                       <span th:if="${opts.href == '/MpsFun/Delete'}">
                           <a th:href="@{/MpsFun/Delete(id=${item.id})}" onclick="return confirm('确定删除?');">删除</a>
                       </span>
                   </span>
               </td>
           </tr>
           </tbody>
       </table>
    </section>
</section>
</body>
</html>